﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Windows.FileStorage.Domain;

namespace Windows.FileStorage.Infrastructure.EFCore
{
    public class AttachmentMapping : IEntityTypeConfiguration<Attachment>
    {
        public void Configure(EntityTypeBuilder<Attachment> builder)
        {
            builder.Property(x => x.OwnerId).IsRequired(false);
            builder.Property(x => x.Type);
            builder.Property(x => x.FileName).HasMaxLength(500);
            builder.Property(x => x.FileSize);
            builder.Property(x => x.FileExtend).HasMaxLength(20);
            builder.Property(x => x.BasePath).HasMaxLength(2000);
            builder.Property(x => x.SavePath).HasMaxLength(2000);
        }
    }
}
